Repository navigation
Conversation
RMiniFile writes and reads the class name, object name and title of TFile keys as TString, but it only implemented the short form with a one byte length. A string of 255 or more characters, e.g. a long RNTuple name or a long title of a TFile, aborted on an R__ASSERT. Implement the long form as TBufferFile::WriteTString does: the byte 255 followed by the length as a 32-bit big-endian integer. RTFString now owns its serialized bytes, and a new helper reads both forms. A key header that does not fit the 16-bit TKey key length now throws. Fixes root-project#14460 Assisted-by: claude-code:claude-opus-5-5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull request:
Lets RMiniFile read and write TFile strings with 255 or more characters. Until now
RTFStringonly implemented the one byte length form, so a long RNTuple name, or a file written byTFilewith a long title or key name, hit anR__ASSERT.Changes or fixes:
RTFStringnow owns its serialized bytes. Strings longer than 254 characters use the long form ofTBufferFile::WriteTString: the byte 255, then the length as a 32-bit big-endian integer.ReadTFString()helper reads both forms. It is used inSearchInDirectory(),GetNTupleProper()andGetNTupleBare().RTFKeythrows anRExceptionwhen a key header does not fit the signed 16-bit key length ofTKey.ntuple_minifile: a TFile title of 255, 256 and 2000 characters, a 300 character RNTuple name in the bare, simple TFile and proper TFile containers, and a key header that is too long.One open question: the reader trusts the long-form length it reads, so a corrupt file can request a large allocation. Should it be bounded? Strings inside a key are limited by the key length, but the name in a bare file is not.
This Description was written with AI assistance (Claude Code, claude-opus-5-5).
Checklist:
This PR fixes #14460